package com.k2data.k2app.common;

import java.util.concurrent.*;

/**
 * @author lidong9144@163.com 17-4-11.
 */
public class ExecutorManager {

    private static ExecutorService executorService = new ThreadPoolExecutor(10,
            30,
            30L,
            TimeUnit.SECONDS,
            new LinkedBlockingDeque<>());

    private ExecutorManager() {}

    public static void submit(Runnable task) {
        executorService.submit(task);
    }

    public static <T> Future<T> submit(Callable<T> task) {
        return executorService.submit(task);
    }

}
